

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>layuiAdmin 角色管理 iframe 框</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
</head>
<body>
	<div style="text-align:center;width:100%;margin-top:10px">
	  <img src="#(user.avatar)" class="layui-circle" style="width: 100px;height: 100px">
	</div>
  <div class="layui-form" lay-filter="layuiadmin-form-role" id="layuiadmin-form-role" style="padding: 20px 30px 0 0;">
    <div class="layui-form-item">
      <label class="layui-form-label">姓名</label>
      <div class="layui-input-block">
      	<input type="hidden" name="userid" value="#(user.userid)">
        <input type="text" value="#(user.name)" autocomplete="off" class="layui-input" readonly="readonly">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">工号</label>
      <div class="layui-input-block">
        <input type="text" value="#(user.jobnumber)" lay-verify="require" autocomplete="off" class="layui-input" readonly="readonly">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">职位</label>
      <div class="layui-input-block">
        <input type="text" value="#(user.position)" lay-verify="require" autocomplete="off" class="layui-input" readonly="readonly">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">角色</label>
      <div class="layui-input-block" id="role">
    </div>
    <div class="layui-form-item layui-hide">
      <button class="layui-btn" lay-submit lay-filter="LAY-user-role-submit" id="LAY-user-role-submit">提交</button>
    </div>
  </div>

  <script src="/layuiadmin/layui/layui.js"></script>  
  <script>
  layui.config({
    base: '/layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index', //主入口模块
    selectM: 'selectM'
  }).use(['index','authtree', 'form','selectM'], function(){
    var $ = layui.$
    ,authtree = layui.authtree
    ,form = layui.form
    ,selectM = layui.selectM;

    //多选标签-所有配置
    var tagIns = selectM({
      //元素容器【必填】
      elem: '#role'
      //候选数据【必填】
      ,data: '/sys/getSelectRole'
      //默认值
      ,selected: [#(roleIds)]
      //最多选中个数，默认5
      ,max: 10
	  //input的name 不设置与选择器相同(去#.)
	  ,name: 'rolesId'
	  //值的分隔符
	  ,delimiter: ','
	  //候选项数据的键名
	  ,field: {idName:'id',titleName:'name'}
      ,verify:'required'
      
    });
    
  })
  </script>
</body>
</html>